package com.lz.utils;

import java.util.Random;

/**
 * 主键生成
 * Created by lz on 2018/8/17.
 */
public class KeyUtil {

    public static synchronized String genUniqueKey(){
        //时间+随机数
        Random random = new Random();
        int i = random.nextInt(900000) + 100000;
        return String.valueOf(i) + System.currentTimeMillis();
    }
}
